<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="/public/favicon.ico">
    <title>首页</title>
    <link href="/public/css/bootstrap.min.css" rel="stylesheet">

    <!--如果把大型script放在最后加载可以提高网页渲染速度-->
    <script src="/public/js/jquery.min.js"></script>
    <script src="/public/js/bootstrap.min.js"></script>
    <script src="/public/js/index.js"></script>
</head>

<body>
<nav class="navbar navbar-default navbar-static-top">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
                    aria-expanded="false" aria-controls="navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">JPlus</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
            <ul class="nav navbar-nav">
                <li class="active"><a href="/">首页</a></li>
                <li><a href="#about" data-toggle="modal" data-target="#myModal">使用说明</a></li>
            </ul>
        </div>
    </div>
</nav>
<!--实验室简介模态框-->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="myModalLabel">实验室简介</h4>
            </div>
            <div class="modal-body">
                <div class="alert alert-info" role="alert">先点击【登录】，按照提示输入信息进行登录。</div>
                <div class="alert alert-info" role="alert">登录成功后，【先】点击【签到】、提示成功后表明此次签到成功！若失败，则退出浏览器重来。</div>
                <div class="alert alert-info" role="alert">在实验室学习完毕，需要离开时，请点击【签退】，签到成功后会有弹窗提示。</div>
                <div class="alert alert-info" role="alert">最后点击【退出登录】，然后可以离开实验室。 </div>
                <div class="alert alert-warning" role="alert">
                    一定要按照以上提示的流程来，否则签到无效。每天只可以签到一次<br>
                    系统比较简单，可能存在我没有测试出来的bug。
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div>
    </div>
</div>

<div class="container">
    <div class="jumbotron">
        <h1>JPlus实验室签到系统</h1>
        <p>欢迎加入JPlus实验室</p>
        <p>请登录以便统计考勤</p>
        <p>
            {% if loginState %}
            <a href="/admin/signin">
                <button type="button" class="btn btn-primary btn-lg" data-toggle="modal"
                        data-target="#exampleModal" data-whatever="@mdo">点击进入签到页 &raquo;
            </button></a>
            {% else %}
            <button type="button" class="btn btn-primary btn-lg" data-toggle="modal"
                    data-target="#exampleModal" data-whatever="@mdo">登录 &raquo;
            </button>
            {% endif %}

        </p>
    </div>
</div>
<!--登录模态框-->
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="exampleModalLabel">登录到JPlus实验室</h4>
            </div>
            <div class="modal-body">
                <form>
                    <div class="form-group">
                        <label for="name" class="control-label">姓名：</label>
                        <input type="text" class="form-control" id="name" name="name">
                    </div>
                    <div class="form-group">
                        <label for="sno" class="control-label">学号：</label>
                        <input type="text" class="form-control" id="sno" name="sno">
                    </div>
                    <div id="myAlert" class="alert alert-danger" style="display: none">
                        <strong>姓名或学号不对</strong>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                {% if loginState %}
                <a href="/admin/signin"><button type="button" class="btn btn-primary" >点击进入签到页</button></a>
                {% else %}
                <button type="button" class="btn btn-primary" id="login">登录</button>
                {% endif %}
            </div>

        </div>
    </div>
</div>
</body>
</html>
